for i in range(1501):
    if i%3==2 and i%5==4 and i%7==6 and 1000<i<1100:
        print(i)